package cn.lyh.iotmanage.dao;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;
import lombok.Data;

/**
 * @author lyh
 * @version 1.0
 * @since 2021/5/20
 */
/**
    * EMQ转发过来所有的主题上报消息
    */
@Data
@TableName(value = "emq_topicmsg")
public class EmqTopicMsgDao {
    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    /**
     * 主题订阅用户名
     */
    @TableField(value = "username")
    private String username;

    /**
     * 订阅的主题名
     */
    @TableField(value = "topic_name")
    private String topicName;

    /**
     * 消息时间戳
     */
    @TableField(value = "publish_received_at")
    private Date publishReceivedAt;

    /**
     * 消息体内容
     */
    @TableField(value = "payload")
    private String payload;

    /**
     * 连接ID
     */
    @TableField(value = "clientid")
    private String clientid;

    public static final String COL_ID = "id";

    public static final String COL_USERNAME = "username";

    public static final String COL_TOPIC_NAME = "topic_name";

    public static final String COL_PUBLISH_RECEIVED_AT = "publish_received_at";

    public static final String COL_PAYLOAD = "payload";

    public static final String COL_CLIENTID = "clientid";
}